<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionDispatch::Routing::RouteWrapper</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionDispatch::Routing::RouteWrapper 
            
                <span class="parent">&lt; 
                    
                    SimpleDelegator
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/actionpack/lib/action_dispatch/routing/inspector_rb.html">actionpack/lib/action_dispatch/routing/inspector.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-action">action</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-constraints">constraints</a>,
              </li>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-controller">controller</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>E</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-endpoint">endpoint</a>,
              </li>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-engine-3F">engine?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-internal-3F">internal?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>J</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-json_regexp">json_regexp</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-name">name</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>P</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-path">path</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-rack_app">rack_app</a>,
              </li>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-regexp">regexp</a>,
              </li>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-reqs">reqs</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>V</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="RouteWrapper.html#method-i-verb">verb</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
        
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-action">
            
              <b>action</b>()
            
            <a href="RouteWrapper.html#method-i-action" name="method-i-action" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-action_source')" id="l_method-i-action_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L67" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-action_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 67</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">action</span>
  <span class="ruby-identifier">requirements</span>[<span class="ruby-value">:action</span>] <span class="ruby-operator">||</span> <span class="ruby-string">':action'</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-constraints">
            
              <b>constraints</b>()
            
            <a href="RouteWrapper.html#method-i-constraints" name="method-i-constraints" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-constraints_source')" id="l_method-i-constraints_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L11" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-constraints_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">constraints</span>
  <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">except</span>(<span class="ruby-value">:controller</span>, <span class="ruby-value">:action</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-controller">
            
              <b>controller</b>()
            
            <a href="RouteWrapper.html#method-i-controller" name="method-i-controller" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-controller_source')" id="l_method-i-controller_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L63" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-controller_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 63</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">controller</span>
  <span class="ruby-identifier">requirements</span>[<span class="ruby-value">:controller</span>] <span class="ruby-operator">||</span> <span class="ruby-string">':controller'</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-endpoint">
            
              <b>endpoint</b>()
            
            <a href="RouteWrapper.html#method-i-endpoint" name="method-i-endpoint" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-endpoint_source')" id="l_method-i-endpoint_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L7" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-endpoint_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 7</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">endpoint</span>
  <span class="ruby-identifier">rack_app</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">rack_app</span>.<span class="ruby-identifier">inspect</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{controller}##{action}&quot;</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-engine-3F">
            
              <b>engine?</b>()
            
            <a href="RouteWrapper.html#method-i-engine-3F" name="method-i-engine-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-engine-3F_source')" id="l_method-i-engine-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L75" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-engine-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 75</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">engine?</span>
  <span class="ruby-identifier">rack_app</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">rack_app</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:routes</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-internal-3F">
            
              <b>internal?</b>()
            
            <a href="RouteWrapper.html#method-i-internal-3F" name="method-i-internal-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-internal-3F_source')" id="l_method-i-internal-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L71" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-internal-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 71</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">internal?</span>
  <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r{\Arails/(info|welcome)}</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-node">%r{\A#{Rails.application.config.assets.prefix}}</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-json_regexp">
            
              <b>json_regexp</b>()
            
            <a href="RouteWrapper.html#method-i-json_regexp" name="method-i-json_regexp" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-json_regexp_source')" id="l_method-i-json_regexp_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L42" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-json_regexp_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 42</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">json_regexp</span>
  <span class="ruby-identifier">str</span> = <span class="ruby-identifier">regexp</span>.<span class="ruby-identifier">inspect</span>.
        <span class="ruby-identifier">sub</span>(<span class="ruby-string">'\A'</span> , <span class="ruby-string">'^'</span>).
        <span class="ruby-identifier">sub</span>(<span class="ruby-string">'\Z'</span> , <span class="ruby-string">'$'</span>).
        <span class="ruby-identifier">sub</span>(<span class="ruby-string">'\z'</span> , <span class="ruby-string">'$'</span>).
        <span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^\//</span> , <span class="ruby-string">''</span>).
        <span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/\/[a-z]*$/</span> , <span class="ruby-string">''</span>).
        <span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\(\?#.+\)/</span> , <span class="ruby-string">''</span>).
        <span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\(\?-\w+:/</span> , <span class="ruby-string">'('</span>).
        <span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\s/</span> , <span class="ruby-string">''</span>)
  <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">str</span>).<span class="ruby-identifier">source</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-name">
            
              <b>name</b>()
            
            <a href="RouteWrapper.html#method-i-name" name="method-i-name" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-name_source')" id="l_method-i-name_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L34" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-name_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 34</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">name</span>
  <span class="ruby-keyword">super</span>.<span class="ruby-identifier">to_s</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-path">
            
              <b>path</b>()
            
            <a href="RouteWrapper.html#method-i-path" name="method-i-path" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-path_source')" id="l_method-i-path_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L30" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-path_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">path</span>
  <span class="ruby-keyword">super</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">to_s</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-rack_app">
            
              <b>rack_app</b>(app = self.app)
            
            <a href="RouteWrapper.html#method-i-rack_app" name="method-i-rack_app" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-rack_app_source')" id="l_method-i-rack_app_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L15" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-rack_app_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">rack_app</span>(<span class="ruby-identifier">app</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">app</span>)
  <span class="ruby-ivar">@rack_app</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">class_name</span> = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">class_name</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;ActionDispatch::Routing::Mapper::Constraints&quot;</span>
      <span class="ruby-identifier">rack_app</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">app</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-constant">ActionDispatch</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Redirect</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">app</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">class_name</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp">/^ActionDispatch::Routing/</span>
      <span class="ruby-identifier">app</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-regexp">
            
              <b>regexp</b>()
            
            <a href="RouteWrapper.html#method-i-regexp" name="method-i-regexp" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-regexp_source')" id="l_method-i-regexp_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L38" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-regexp_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 38</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">regexp</span>
  <span class="ruby-identifier">__getobj__</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">to_regexp</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-reqs">
            
              <b>reqs</b>()
            
            <a href="RouteWrapper.html#method-i-reqs" name="method-i-reqs" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-reqs_source')" id="l_method-i-reqs_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L55" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-reqs_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 55</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">reqs</span>
  <span class="ruby-ivar">@reqs</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">reqs</span> = <span class="ruby-identifier">endpoint</span>
    <span class="ruby-identifier">reqs</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #{constraints.to_s}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">constraints</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">reqs</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-verb">
            
              <b>verb</b>()
            
            <a href="RouteWrapper.html#method-i-verb" name="method-i-verb" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-verb_source')" id="l_method-i-verb_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/decfa35d4a239ed807f055fef3cef4884ed605c1/actionpack/lib/action_dispatch/routing/inspector.rb#L26" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-verb_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/routing/inspector.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">verb</span>
  <span class="ruby-keyword">super</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/[$^]/</span>, <span class="ruby-string">''</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    